#include "privatechatsesiondetail.h"
#include "qpushbuttonandqlael.h"
#include <QVBoxLayout>
#include <QHBoxLayout>

PrivateChatSesionDetail::PrivateChatSesionDetail(QWidget *parent)
    : QDialog(parent)
{
    // 设置对话框属性
    this->setWindowTitle("个人会话详情");
    this->setWindowIcon(QIcon(":/Resources/windowIcon.png"));
    this->setFixedSize(250, 170);
    this->setContentsMargins(10,5,10,0);
    this->setAttribute(Qt::WA_DeleteOnClose);
    this->setStyleSheet(
        "QDialog {"
        "   background: qlineargradient(x1:0, y1:0, x2:1, y2:1,"
        "               stop:0 #1a1a2e, stop:1 #16213e);"
        "   color: #e0e0e0;"
        "}");

    QVBoxLayout *mainLayout = new QVBoxLayout();
    mainLayout->setSpacing(10);
    mainLayout->setContentsMargins(20, 20, 20, 20);

    // 创建按钮区域的水平布局
    QHBoxLayout *buttonLayout = new QHBoxLayout();
    buttonLayout->setSpacing(20);

    first = new QPushButtonAndQLael(QIcon(":/Resources/plus.png"), "添加");
    second = new QPushButtonAndQLael(QIcon(":/Resources/avator1.jpg"), "小曹要fsadf!!!");

    buttonLayout->addWidget(first);
    buttonLayout->addWidget(second);

    deletebtn = new QPushButton("删除好友");
    deletebtn->setFixedHeight(35);
    deletebtn->setStyleSheet(
        "QPushButton {"
        "   background: qlineargradient(x1:0, y1:0, x2:1, y2:0,"
        "               stop:0 #ff6b6b, stop:1 #ff8e8e);"
        "   border: none;"
        "   border-radius: 8px;"
        "   color: white;"
        "   font-weight: bold;"
        "}"
        "QPushButton:hover {"
        "   background: qlineargradient(x1:0, y1:0, x2:1, y2:0,"
        "               stop:0 #ff8e8e, stop:1 #ffa8a8);"
        "}"
        "QPushButton:pressed {"
        "   background: qlineargradient(x1:0, y1:0, x2:1, y2:0,"
        "               stop:0 #ff5252, stop:1 #ff6b6b);"
        "}");

    // 添加到主布局
    mainLayout->addLayout(buttonLayout);
    mainLayout->addWidget(deletebtn,0,Qt::AlignVCenter);
    mainLayout->addStretch(1);  // 添加弹性空间

    this->setLayout(mainLayout);
}
